<template>
	<view class="content">
		<!--顶部标题-->
		<view class="box-top">
			<view class="main-box">
				<!--头像-->
				<u-avatar src="https://yj.xiesinder.cn/prophet/logo.png" size="80"></u-avatar>
			</view>
			<view class="title">
				<h1>{{ socialSecurity.title }}</h1>
			</view>
		</view>
		<view class="box-body">
			<!--中间内容-->
			<view class="body-content">
				<rich-text :nodes="socialSecurity.info"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from 'vuex'
	import {
		getSocialSecurity
	} from '@/plugins/api/static.js'
	export default {
		data() {
			return {
				socialSecurity: {
					title: '',
					info: ''
				}
			}
		},
		onLoad() {
			this.getSocialSecurityInfo()
		},
		onShow() {},
		// 计算属性
		computed: {
			...mapState('user', ['modalShow', 'loginState', 'openId'])
		},
		methods: {
			...mapActions('user', ['openModalAction']),
			getSocialSecurityInfo() {
				getSocialSecurity().then(res => {
					this.socialSecurity = res.data.data
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	page {
		background: #f8f8f8;
	}

	.content {
		width: 100%;

		// 顶部
		.box-top {
			width: 90%;
			height: 300rpx;
			left: 5%;
			position: relative;
			/* 超出隐藏需要加上 */
			overflow: hidden;

			.main-box {
				float: left;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				height: 220rpx;
				width: 100%;
			}

			.title {
				float: left;
				text-align: center;
				height: 80rpx;
				width: 100%;
				font-size: 40rpx;

				/* 加上 -webkit- 注意兼容 */
				h1 {
					background: -webkit-linear-gradient(135deg,
							#0eaf6d,
							#ff6ac6 25%,
							#147b96 50%,
							#e6d205 55%,
							#2cc4e0 60%,
							#8b2ce0 80%,
							#ff6384 95%,
							#08dfb4);
					/* 文字颜色填充设置为透明 */
					-webkit-text-fill-color: transparent;
					/* 背景裁剪，即让文字使用背景色 */
					-webkit-background-clip: text;
					/* 背景图放大一下，看着柔和一些 */
					-webkit-background-size: 200% 100%;
					/* 应用动画flowCss 12秒速度 无限循环 线性匀速动画*/
					-webkit-animation: flowCss 12s infinite linear;
				}

				@-webkit-keyframes flowCss {
					0% {
						/* 移动背景位置 */
						background-position: 0 0;
					}

					100% {
						background-position: -400% 0;
					}
				}

				h1:hover {
					-webkit-animation: flowCss 4s infinite linear;
				}
			}
		}

		// 中间内容
		.box-body {
			width: 90%;
			// height: 800rpx;
			left: 5%;
			position: relative;
			/* 超出隐藏需要加上 */
			overflow: hidden;
			margin-top: 30rpx;
			box-shadow: 0 2rpx 4rpx 0 rgba(0, 0, 0, 0.2), 0 3rpx 6rpx 0 rgba(0, 0, 0, 0.19);

			.body-content {
				float: left;
				align-items: center;
				justify-content: center;
				// height: 700rpx;
				padding-top: 60rpx;
				width: 90%;
				padding-left: 5%;
				color: #848484;
				line-height: 55rpx;
				text-indent: 2em;

				.h1,
				.h2 {
					color: #2baaff;
					text-align: center;
					text-indent: 0em;
				}

				.h3 {
					color: #ffaa00;
				}
			}
		}
	}
</style>